package cn.doctorpda.conference.ui.search;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;

import org.greenrobot.eventbus.EventBus;

import cn.doctorpda.conference.R;
import cn.doctorpda.conference.event.GetMessage;
import cn.doctorpda.conference.event.ToNews;
import cn.doctorpda.conference.ui.BaseActivity;
import cn.doctorpda.conference.utils.T;

public class SearchActivity extends BaseActivity {

    public static boolean isForeground = false;
    private String toNews="";

    @Override
    protected Fragment createFragment() {
        return SearchFragment.newInstance(toNews);
    }

    @Override
    protected int getLayoutResId() {
        return R.layout.activity_base;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        Intent flag = getIntent();
        Bundle bundle = flag.getExtras();
        if (bundle != null)
            toNews = bundle.getString("toNews");
//        EventBus.getDefault().post(new ToNews(toNews));
//        T.showShort(this, toNews);
        super.onCreate(savedInstanceState);//放后面
    }

    @Override
    protected void onResume() {
        isForeground = true;
        super.onResume();
    }

    @Override
    protected void onPause() {
        isForeground = false;
        super.onPause();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
}
